package com.compunit.composite.core.interfaces;

import java.net.URISyntaxException;
import java.net.URL;

/**
 * <code>IResourceExporter</code> defines the interface
 * of the utility unit that is responsible for exporting
 * file resources into a jar file.
 *
 * @author Yi Wang (Neakor)
 * @version Creation date: 11-21-2009 16:56 EST
 * @version Modified date: 12-05-2009 13:57 EST
 */
public interface IResourceExporter extends IExporter {

	/**
	 * Add the file linked by given URL to the exporter
	 * cache for exporter.
	 * <p>
	 * This method automatically excludes duplicates.
	 * @param url The <code>URL</code> to the file.
	 * @throws URISyntaxException If given url is invalid.
	 */
	public void addResource(final URL url) throws URISyntaxException;
	
	/**
	 * Remove the resource with given filename from the
	 * exporter cache.
	 * @param filename The <code>String</code> of the file.
	 */
	public void removeResource(final String filename);
	
	/**
	 * Check if the resource with given filename has
	 * already been cached by the exporter.
	 * @param filename The <code>String</code> of the file.
	 * @return <code>true</code> if given resource
	 * file is already cached. <code>false</code>
	 * otherwise.
	 */
	public boolean containsResource(final String filename);
}
